<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>对象属性间接表示法</title>
  </head>
  <body>
    <p>在ES6，对象属性值等于属性值，则可以省略属性值</p>
    <pre>
      let foo='bar'
      //ES6 简写
      let baz = {foo}
      baz // {foo:"bar"}

      //等价于
      let baz = {foo:foo}
    </pre>
  </body>
</html>
<script>
  let foo = "bar";
  //ES6 简写
  let baz = { foo };
  baz; // {foo:"bar"}

  //等价于
  let ba = { foo: foo };
</script>
